package com.excerise.poly.array;

/**
 *
 *
 * @author Way on 2021/8/3
 */
public class Teacher extends Person {

    private double salary;

    public Teacher(String name, int age, double salary) {
        super(name, age);
        this.salary = salary;
    }

    public double getSalary() {
        return salary;
    }

    public void setSalary(double salary) {
        this.salary = salary;
    }

    @Override
    public String say() {
        return super.say() + " salary = " + salary;
    }

    public void teach() {
        System.out.println(getName() + " 正在教课");
    }
}
